// Copyright (c)  YISH. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using NSQL.Generator.Formatters;
using NSQL.LogicalResource;

namespace NSQL.Generator
{
    [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
    public class SqlGeneratorSettings
    {
        public bool Optimized { get; set; } = true;
        public ILogicalDatabase Database { get; set; }
        public KeywordStyle KeywordStyle { get; set; } = KeywordStyle.None;
        public bool BraceJoin { get; set; } = true;

        public CultureInfo CultureInfo
        {
            get => _cultureInfo;
            set => _cultureInfo = value ?? throw new ArgumentNullException(nameof(value));
        }


        private CultureInfo _cultureInfo = DefaultCultureInfo;
        protected static readonly CultureInfo DefaultCultureInfo = new CultureInfo("zh-CN")
        {
            DateTimeFormat =
            {
                ShortDatePattern = "yyyy/MM/dd",
                LongTimePattern = "HH:mm:ss"
            }
        };
    }
}